import Vue from 'vue'
import VueRouter from 'vue-router'
import login from '@/views/login.vue'
import register from '@/views/register.vue'
import Layout from '@/views/Layout.vue'
import detail from '@/views/detail.vue'
import FirstPage from '@/views/FirstPage.vue'
import FindHouse from '@/views/FindHouse.vue'
import News from '@/views/News.vue'
import My from '@/views/My.vue'
import collect from '@/views/collect.vue'
import MyRent from '@/views/MyRent.vue'
import ToRent from '@/views/ToRent.vue'
import City from '@/views/city.vue'
import Search from '@/views/search.vue'
Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/login',
      component: login
    },
    {
      path: '/register',
      component: register
    },
    {
      path: '/detail',
      component: detail
    },
    {
      path: '/city',
      component: City
    },
    {
      path: '/',
      component: Layout,
      redirect: '/FirstPage',
      children: [
        {
          path: 'FirstPage',
          component: FirstPage
        },
        {
          path: 'FindHouse',
          component: FindHouse
        },
        {
          path: 'News',
          component: News
        },
        {
          path: 'My',
          component: My
        }
      ]
    },
    {
      path: '/collect',
      component: collect
    },
    {
      path: '/MyRent',
      component: MyRent
    },
    {
      path: '/search',
      component: Search
    },
    {
      path: '/ToRent',
      component: ToRent
    }

  ]
})

export default router
